1 PrefaceThe database large concurrency operation takes into account the deadlock and lock performance issues. See online most vague (especially update lock), so here is a concise explanation, for the following description of the convenient, here with T1 for a database execution request, T2 represents another request, can also be understood as T1 a thread, T2 for another thread. T3,t4 and so on. The following is an example of SQL Server (2005).2 kinds
: The s lock is used for reading and the X lock is used for writing.
From the programmer's perspective, there are two types of locks: Optimistic locks and pessimistic locks ). Optimistic locks are used by the database system to automatically implement lock management when processing data. We know from the past that SQL server adopts optimistic locks: For update, insert, delete uses the X lock automatically. For select, the S lock is automatically used
To create a database:1 CREATE DATABASETest--The name of the database to be created2 on PRIMARY3 (4 --specific description of the database file5NAME='Test_data',--logical name of the master data file6FILENAME='E:\project\Test_data.mdf',--physical name of the master data file7SIZE=5MB,--Initial size of master data file8MAXSIZE=100MB,--maximum growth of the master data file9FileGrowth= the% --growth rate of master data filesTen ) One LOG on A ( - --the specific
Some time ago, ** the DBA of the company came to our training. I talked about a lot of MYSQL optimizations. QA Stage 1: the programmer asked: "Can the with nolock in SQL statements read other locked data except for non-locked tables"
The lecturer muttered for a long time and did not explain clearly. It may be that MYSQL does not have this mechanism.) Another programmer of the company gave a very concise and clear answer.
With nolock will not be affect
a single row, they usually need to reset this setting.
SERIALIZABLE-equivalent to HOLDLOCK.
TABLOCK-Lock Based on the table level. You may need to use this prompt when running multiple table-level data operations.
UPDLOCK-when reading a table, use the update lock instead of the shared lock, and keep the lock until the transaction ends. Its advantage is that it allows you to read data without a lock and update data as quickly as possible.
XLOCK-exclus
Java. util. Date and Java. SQL. Date, java. SQL. Time, java. SQL. Timestamp interchange, java. SQL. timestamp
1. SQL time type to util time type
Principle: java. SQL. date, java. SQL. t
Tags: implementation mechanism originally page organizes tables based on free article content index ClustFollowing the book on SQL tuning (SQL tuning or SQL optimization) in the essentials of high-performance SQL tuning and case resolution, we talk today about one of the most important core mechanisms of
uses the exclusive locks of the table. This lock prevents other transactions from reading or updating tables and holding them until the end of the statement or transaction. The UPDLOCK uses an update lock when reading a table, instead of a shared lock, and retains the lock until the end of the statement or transaction. The advantage of UPDLOCK is that it allows you to read data (without blocking other transactions) and update the data at a later time, ensuring that the data has not been change
SQL Server data table field custom Custom Data Format method, SQL Server
This document describes how to customize the Custom Data Format of SQL Server data table fields. We will share this with you for your reference. The details are as follows:
-- Modify the field CompanyId In the TABLE SYS_Company to customize the user-added constraint alter table [dbo]. [SYS
35. use SQL query analyzer and SQL profilerUse SQL query AnalyzerUse SQL profilerOptimize T-SQL statementSummaryIn this chapter, we will continue with the description of the pre-stored procedures in Chapter 21st. This chapter describes how to use
Tags: and fast speaking tuning market buffer way a completely"High-performance SQL Tuning essentials and Case Resolution" a book has been launched, many enthusiastic readers on the contents of the book and some of the specific questions raised questions, because of the numerous readers plus my daily work busy, here on the SQL tuning learning to discuss and a unified answer to the hot issues.First, let's tal
13. T-SQL and SQL query AnalyzerWhat is SQL?What is T-SQL?Introduce new features of T-SQLHow to Use T-SQLSummaryIn this chapter, we will introduce some basic concepts about the Structured Query Language What is SQL? SQL is a datab
Sqlserver Management
Common field types: Bit (optional values: 0, 1), datetime, Int, varchar, and nvarchar (may contain nvarchar for Chinese)
Differences between varchar, nvarchar, and char (N): Fill in spaces for less than N parts of char (n. VaR: Variable, variable.
SQL statements
Use strings in SQL statementsSingle quotes.
SQL
performance as accessing memory-optimized tables using locally compiled stored procedures. When you run an ad hoc query, or when you migrate an application to in-memory OLTP, as a step in the migration process, interoperability is the right choice before migrating the stored procedures that have the most impact on performance. Interpreted Transact-SQL should also be used when it is necessary to access both memory-optimized tables and disk-based table
---- Set a non-primary key to clustered index [Step 4] to: http://king123654789.iteye.com/blog/1169191
1. View All indexes. Clustered indexes are created on the primary key by default.Sp_helpindex person
2. -- delete the primary key constraint and remove the index constraint on the primary key queried in [1], for example, PK _ person _ 117F9D94. Remove the primary key constraint from the primary key field. This field is not the primary key.Alter table person drop constraint PK _ person _ 117F9
+ short S lock(Definition of isolation level in SQLSerializableREPEATABLE READRead CommittedRead uncomitted)Repeatable READ-The "non-repeatable read" condition is guaranteed only when the X and S locks are long locks* Lock Conversion* Two-segment lock protocol with lock conversion* Growth phaseAvailable for Lock-sAvailable for Lock-xLock-s can be upgraded to Lock-x (upgrade)* Reduction phaseCan release lock-sCan release lock-
Tags: properties LTE record recovery database varchar OBJECT_ID New entityMemory-Optimized tables are a new feature of SQL Server 2014, which can put tables in memory, which significantly improves DML performance.For memory-optimized tables, refer to the two Heroes article: SQL Server 2014 new features Quest (1)-Memory Database try SQLSERVER2014 memory-Optimized table It is also easy to create a memory-opti
Artificial Intelligence automatic SQL optimization tools-SQLTuning for SQL Server, SQL-sqltuning
In response to this situation, the artificial intelligence automatic SQL optimization tool came into being. Now I will introduce this tool: SQLTuning for SQL Server.
1.
First of all, the so-called SQL dynamic and static, refers to when SQL statements are compiled and executed, both are used in SQL embedded programming, which is referred to as embedded refers to the SQL statement embedded in the high-level language, rather than the type of microcontroller embedded programming.In a high
features that are not supported:· TRUNCATE TABLE;· MERGE (target of memory-optimized tables);· Dynamic and key-value-set-based cursors (these are automatically demoted to static cursors);· Cross-database queries;· Cross-database transactions;· Linked servers;· Locking hints: TABLOCK, XLOCK, Paglock, etc. (Nolock support);· Isolation level hints readuncommitted, readcommitted readcommittedlock;· Memory-Optimized table types and tables are not just var
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.